import { get, post } from '@/utils/request'
export default {
  namespaced: true,
  state: {
    infoCategorys: [],
    allInfoCategorys: [],
  },
  mutations: {
    set_infoCategorys(state, data) {
      state.infoCategorys = data;
    },
    set_allInfoCategorys(state, data) {
      state.allInfoCategorys = data;
    }
  },
  actions: {
    async getInfoCategorys({ commit }) {
      let res = await get('/category/findCategoryTree');
      // console.log(res);
      commit('set_infoCategorys', res.data);
    },
    async getAllInfoCategorys({ commit }) {
      let res = await get('/category/findAll');
      // console.log(res);
      commit('set_allInfoCategorys', res.data)
    }
  }
}